package com.centaline.androidsalesblog.api.sale;

import com.baidu.mapapi.model.LatLng;
import com.centaline.androidsalesblog.api.SaleApi;
import com.centaline.androidsalesblog.model.responseobject.EsfEstateListRo;
import com.centanet.framework.interfaces.IResponseListener;

/**
 * 小区列表
 * Created by guilin on 16/1/11.
 */
public class EsfEstateListApi extends SaleApi<EsfEstateListRo> {

    private int startIndex = 0;
    private int pageCount = 10;
    private String type = "R";
    private String posttype = "s";
    private String scopeId;
    private LatLng latLng;
    private String round;
    private String avgpriceid;
    private String subwayid;
    private String stationid;
    private String sort;
    private String cestcodes;
    private String min;
    private String max;

    public EsfEstateListApi(Class<?> tag, Class<EsfEstateListRo> aClass, IResponseListener<EsfEstateListRo> iResponseListener) {
        super(tag, aClass, iResponseListener);
    }

    public void setStartIndex(int startIndex) {
        this.startIndex = startIndex;
    }

    public int getStartIndex() {
        return startIndex;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public void setScopeId(String scopeId) {
        this.scopeId = scopeId;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setPosttype(String posttype) {
        this.posttype = posttype;
    }

    public void setLatLng(LatLng latLng) {
        this.latLng = latLng;
    }

    public void setRound(String round) {
        this.round = round;
    }

    public void setAvgpriceid(String avgpriceid) {
        this.avgpriceid = avgpriceid;
    }

    public void setSubwayid(String subwayid) {
        this.subwayid = subwayid;
    }

    public void setStationid(String stationid) {
        this.stationid = stationid;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public void setCestcodes(String cestcodes) {
        this.cestcodes = cestcodes;
    }

    public void setMin(String min) {
        this.min = min;
    }

    public void setMax(String max) {
        this.max = max;
    }

    public void reset() {
        type = "R";
        latLng = null;
        scopeId = "";
        subwayid = "";
        stationid = "";
    }

    @Override
    protected void setParams() {
        resetParams();
        putParams("startIndex", startIndex);
        putParams("pageCount", pageCount);
        putParams("type", type);
        putParams("posttype", posttype);
        putStringParams("scopeId", scopeId);
        putStringParams("avgpriceid", avgpriceid);
        putStringParams("subwayid", subwayid);
        putStringParams("stationid", stationid);
        putStringParams("sort", sort);
        putStringParams("cestcodes", cestcodes);
        putStringParams("min", min);
        putStringParams("max", max);
        if (latLng != null) {
            putParams("lat", latLng.latitude);
            putParams("lng", latLng.longitude);
            putStringParams("round", round);
        }
    }

    @Override
    protected String getPath() {
        return "EsfEstate";
    }
}
